// pages/credit_rating/credit_rating.js
import {
  http
} from '../../utils/http'
Page({

  /**
   * 页面的初始数据
   */
  data: {

  },

  // findCredit(e) {
  //   let _that = this
  //   http.request({
  //     url: '/findCreditByIdCard',
  //     data: {
  //       idCard: this.data.idCard
  //     },
  //     method: 'GET',
  //     header: {
  //       'content-type': 'application/json;charset=utf-8'
  //     },
  //     success(data) {
  //       console.log(data.data)
  //       if (data.data) {
  //         _that.setData({
  //           // 个人情况
  //           personMessageAge: data.data.personMessageAge,
  //           personMessageEdu: data.data.personMessageEdu,
  //           personMessageHealth: data.data.personMessageHealth,
  //           //家庭情况
  //           familyMessageMarry: data.data.familyMessageMarry,
  //           familyMessageFamilycount: data.data.familyMessageFamilycount,
  //           familyMessageAppraise: data.data.familyMessageAppraise,
  //           familyMessageHouse: data.data.familyMessageHouse,
  //           // 财务情况
  //           // financeMessage: data.data.financeMessage,
  //           financeMessageDebtratio: data.data.financeMessageDebtratio,
  //           financeMessageJzc: data.data.financeMessageJzc,
  //           financeMessageRj: data.data.financeMessageRj,
  //           financeMessageDw: data.data.financeMessageDw,
  //           // 职业情况
  //           // professionalMessage: data.data.financeMessageDebtratio,
  //           professionalMessageType: data.data.professionalMessageType,
  //           professionalMessageEconomic: data.data.professionalMessageEconomic,
  //           professionalMessageProspects: data.data.professionalMessageProspects,
  //           professionalMessageYear: data.data.professionalMessageYear,
  //           professionalMessageJobs: data.data.professionalMessageJobs,
  //           professionalMessageTitle: data.data.professionalMessageTitle,
  //           // 个人信用记录
  //           personalCredit: data.data.personalCredit,
  //           // 保险情况
  //           insuranceSituation: data.data.insuranceSituation,
  //           housingProvidentFund: data.data.housingProvidentFund,
  //           socialInsurance: data.data.socialInsurance,
  //           // 总分
  //           total_score: data.data.total_score,
  //         })

  //         wx.hideLoading({
  //           success: (res) => {},
  //         })
  //       } else {

  //       }
  //     }
  //   })
  // },

  // saveCredit(e) {
  //   let _that = this
  //   // debugger
  //   http.request({
  //     url: '/editCreditRating',

  //     data: {
  //       idCard: this.data.idCard,
  //       // 个人情况
  //       personMessageAge: this.data.personMessageAge,
  //       personMessageEdu: this.data.personMessageEdu,
  //       personMessageHealth: this.data.personMessageHealth,
  //       //家庭情况
  //       familyMessageMarry: this.data.familyMessageMarry,
  //       familyMessageFamilycount: this.data.familyMessageFamilycount,
  //       familyMessageAppraise: this.data.familyMessageAppraise,
  //       familyMessageHouse: this.data.familyMessageHouse,
  //       // 财务情况
  //       // financeMessage: data.data.financeMessage,
  //       financeMessageDebtratio: this.data.financeMessageDebtratio,
  //       financeMessageJzc: this.data.financeMessageJzc,
  //       financeMessageRj: this.data.financeMessageRj,
  //       financeMessageDw: this.data.financeMessageDw,
  //       // 职业情况
  //       // professionalMessage: data.data.financeMessageDebtratio,
  //       professionalMessageType: this.data.professionalMessageType,
  //       professionalMessageEconomic: this.data.professionalMessageEconomic,
  //       professionalMessageProspects: this.data.professionalMessageProspects,
  //       professionalMessageYear: this.data.professionalMessageYear,
  //       professionalMessageJobs: this.data.professionalMessageJobs,
  //       professionalMessageTitle: this.data.professionalMessageTitle,
  //       // 个人信用记录
  //       personalCredit: this.data.personalCredit,
  //       // 保险情况
  //       insuranceSituation: this.data.insuranceSituation,
  //       housingProvidentFund: this.data.housingProvidentFund,
  //       socialInsurance: this.data.socialInsurance,
  //     },
  //     method: 'POST',
  //     header: {
  //       'content-type': 'application/json;charset=utf-8'
  //     },
  //     success(data) {
  //       if (data.data) {
  //         wx.showToast({
  //           title: '保存成功!',
  //           icon: 'success',
  //           mask: true,
  //           duration: 1000,
  //         })
  //         http.request({
  //           url: '/findCreditByIdCard',
  //           data: {
  //             idCard: this.data.idCard
  //           },
  //           method: 'GET',
  //           header: {
  //             'content-type': 'application/json;charset=utf-8'
  //           },
  //           success(data) {
  //             console.log(data.data)
  //             if (data.data) {
  //               _that.setData({
  //                 // 个人情况
  //                 personMessageAge: data.data.personMessageAge,
  //                 personMessageEdu: data.data.personMessageEdu,
  //                 personMessageHealth: data.data.personMessageHealth,
  //                 //家庭情况
  //                 familyMessageMarry: data.data.familyMessageMarry,
  //                 familyMessageFamilycount: data.data.familyMessageFamilycount,
  //                 familyMessageAppraise: data.data.familyMessageAppraise,
  //                 familyMessageHouse: data.data.familyMessageHouse,
  //                 // 财务情况
  //                 // financeMessage: data.data.financeMessage,
  //                 financeMessageDebtratio: data.data.financeMessageDebtratio,
  //                 financeMessageJzc: data.data.financeMessageJzc,
  //                 financeMessageRj: data.data.financeMessageRj,
  //                 financeMessageDw: data.data.financeMessageDw,
  //                 // 职业情况
  //                 // professionalMessage: data.data.financeMessageDebtratio,
  //                 professionalMessageType: data.data.professionalMessageType,
  //                 professionalMessageEconomic: data.data.professionalMessageEconomic,
  //                 professionalMessageProspects: data.data.professionalMessageProspects,
  //                 professionalMessageYear: data.data.professionalMessageYear,
  //                 professionalMessageJobs: data.data.professionalMessageJobs,
  //                 professionalMessageTitle: data.data.professionalMessageTitle,
  //                 // 个人信用记录
  //                 personalCredit: data.data.personalCredit,
  //                 // 保险情况
  //                 insuranceSituation: data.data.insuranceSituation,
  //                 housingProvidentFund: data.data.housingProvidentFund,
  //                 socialInsurance: data.data.socialInsurance,
  //                 // 总分
  //                 total_score: data.data.total_score,
  //               })

  //               wx.hideLoading({
  //                 success: (res) => {},
  //               })
  //             } else {

  //             }
  //           }
  //         })
  //         // setTimeout(()=>{
  //         //   wx.navigateTo({
  //         //     url: '/pages/home/home',
  //         //   })
  //         //  }, 1500)

  //       } else {
  //         wx.showToast({
  //           title: `保存失败!`,
  //           icon: 'error',
  //           mask: true,
  //           duration: 1500,
  //         })
  //       }

  //     }
  //   })
  // },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {

  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide() {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload() {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {

  }
})